//
//  BaseNavigationController.m
//  TeamInformatization
//
//  Created by 李光磊 on 2019/4/1.
//  Copyright © 2019 SPIC. All rights reserved.
//

#import "BaseNavigationController.h"

@interface BaseNavigationController ()

@end

@implementation BaseNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Private
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{
    if (self.viewControllers.count > 0) {
        viewController.hidesBottomBarWhenPushed = YES;
    }
    [super pushViewController: viewController animated:animated];
}

#pragma mark - StatusBar
- (UIStatusBarStyle)preferredStatusBarStyle
{
    UIViewController *controller = self.viewControllers.lastObject;
    if (controller) {
        BOOL overriden = [controller.class instanceMethodForSelector:@selector(preferredStatusBarStyle)] != [UIViewController instanceMethodForSelector:@selector(preferredStatusBarStyle)];
        if (overriden) {
            return [controller preferredStatusBarStyle];
        }
    }
    return UIStatusBarStyleDefault;
}

- (UIStatusBarAnimation)preferredStatusBarUpdateAnimation
{
    return UIStatusBarAnimationSlide;
}

@end
